/*******************************************************************************
 * This file is part of blueprint4j www.blueprint4j.org.
 * 
 *     blueprint4j is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     blueprint4j is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 * 
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with blueprint4j. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package blueprint4j.utils;

import java.util.*;

public class VectorInteger {
	private Vector store=new Vector();

	public Integer get(int pos){
		return (Integer)store.get(pos);
	}
	
	public void add(Integer item){
		store.add(item);
	}
	
	public void add(int item){
		add(new Integer(item));
	}
	
	public void set(int pos,Integer item) {
		store.set(pos,item);
	}
	
	public boolean remove(Integer item){
		return store.remove(item);
	}

	public Integer remove(int pos){
		return (Integer) store.remove(pos);
	}
	
	public void clear() {
		store.clear();
	}
	
	public int size(){
		return store.size();
	}
	
	public int [] toArray() {
		int array[] = new int[size()];
		for (int i =0;i < size();i++) {
			array[i] = get(i).intValue();
		}
		return array;
	}
	
	public String toString(String delim) {
		String buff = "";
		for (int i = 0;i < size();i++) {
			buff += get(i)+delim;
		}
		if (buff.length() > 0) {
			buff = buff.substring(0,buff.length()-delim.length());
		}
		return buff;
	}
}

